package git.jas0nch.final4it.enums;

/**
 * projectName : final4it
 * className: AlgorithmEnum
 * description: TODO 类描述
 *
 * @author : chengjiang@asiainfo.com
 * @date: 2022/05/05
 */
public enum AlgorithmEnum {

    KNN("tree.csv","knn"),
    LINEAR("housing.csv","linear"),
    SVM("cancer.csv","svm"),
    CART("forestfires.csv","CART"),
    LOGISTIC("iris.csv","logistic");

    private String path;
    private String algorithmName;

    AlgorithmEnum(String path,String algorithmName) {
        this.algorithmName = algorithmName;
        this.path = path;
    }

    /**
     * @description :
     * @param path
     * @return : java.lang.String
     * @author : git.jas0nch
     * date : 2022/5/6
     **/
    public static String getModelString(String path){
        AlgorithmEnum[] algorithmEnums = AlgorithmEnum.values();
        for (AlgorithmEnum anEnum : algorithmEnums) {
            if (path.equals(anEnum.getPath())) {
                return anEnum.getAlgorithmName();
            }
        }
        return "";
    }

    public String getAlgorithmName() {
        return algorithmName;
    }

    public void setAlgorithmName(String algorithmName) {
        this.algorithmName = algorithmName;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }
}
